package com.example.demo.entity.request.uiTestCaseSuiteReq;

import com.example.demo.entity.request.ParamValidate;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.StringUtils;

@Data
public class UITestCaseSuiteAddReq implements ParamValidate {
    @ApiModelProperty(value = "UI类别名称")
    private String name;
    @ApiModelProperty(value = "项目id")
    private Long projectId;
    @ApiModelProperty(value = "备注")
    private String remark;

    @Override
    public void validate() {
        if (projectId == null || projectId <= 0){
            throw new IllegalArgumentException("项目id不能为空");
        }
        if (StringUtils.isEmpty(name)){
            throw new IllegalArgumentException("名称不能为空");
        }
    }
}
